Skip to content

Conversation

cgoldberg
Copy link
Member

@cgoldberg cgoldberg commented Oct 13, 2025

User description

🔗 Related Issues

Fixes #16417

💥 What does this PR do?

This PR updates the internal Python test suite and CI job to use Chrome instead of Firefox for Remote tests.

This also updates the driver fixture to cleanup downloaded files between tests if running a Remote WebDriver so we don't leak between tests if we don't close the browser.

🔄 Types of changes

  • Test/CI

PR Type

Tests


Description

  • Switch Remote WebDriver tests from Firefox to Chrome

  • Update test fixtures to use chromium_options instead of firefox_options

  • Modify CI workflow to run remote tests with Chrome browser

  • Change default Remote options configuration from Firefox to Chrome


Diagram Walkthrough

flowchart LR
  A["conftest.py"] -- "Update default options" --> B["Remote: Firefox → Chrome"]
  C["remote_connection_tests.py"] -- "Replace fixtures" --> D["chromium_options"]
  E["remote_custom_locator_tests.py"] -- "Replace fixtures" --> D
  F[".github/workflows/ci-python.yml"] -- "Update CI" --> G["browser: chrome"]
Loading

File Walkthrough

Relevant files
Configuration changes
conftest.py
Update Remote driver default options to Chrome                     

py/conftest.py

  • Changed remote driver default options from FirefoxOptions to
    ChromeOptions
  • Updated Remote driver initialization to use Chrome capabilities
    (goog:chromeOptions)
  • Removed Firefox-specific Wayland environment configuration for Remote
    driver
+3/-3     
ci-python.yml
Switch CI remote tests to Chrome browser                                 

.github/workflows/ci-python.yml

  • Updated CI workflow matrix to use chrome instead of firefox for remote
    tests
+1/-1     
Tests
remote_connection_tests.py
Switch Remote test fixtures from Firefox to Chrome             

py/test/selenium/webdriver/remote/remote_connection_tests.py

  • Replaced firefox_options fixture with chromium_options in timeout
    tests
  • Moved Firefox-specific screenshot test to use explicit Firefox options
  • Updated BiDi test to use Chrome options instead of Firefox
+13/-11 
remote_custom_locator_tests.py
Update custom locator test to use Chrome options                 

py/test/selenium/webdriver/remote/remote_custom_locator_tests.py

  • Changed custom locator driver fixture from firefox_options to
    chromium_options
+2/-2     

@cgoldberg cgoldberg added C-py Python Bindings B-build Includes scripting, bazel and CI integrations labels Oct 13, 2025
@cgoldberg
Copy link
Member Author

cgoldberg commented Oct 14, 2025

I found the weirdest Chrome issue while working on this PR. Any file the test tries to download gets downloaded as an .html (.htm on windows) file instead of the correct file extension. I can't reproduce it when manually launching the same browser or with a simple script... but in the tests, it renames the files (like file_1.txt downloads as file_1.html).

I have the tests altered to compensate for this, but I have no idea what is going on.

@SeleniumHQ SeleniumHQ deleted a comment from qodo-merge-pro bot Oct 15, 2025
@SeleniumHQ SeleniumHQ deleted a comment from qodo-merge-pro bot Oct 15, 2025
@cgoldberg cgoldberg requested a review from navin772 October 16, 2025 12:18
@cgoldberg
Copy link
Member Author

@navin772 this is really strange: #16419 (comment)

I'm not sure what to do about that, but I think this is good to merge.

@navin772
Copy link
Member

navin772 commented Oct 16, 2025

I remember seeing this behaviour few months back when implementing something, most probably a chromedriver issue.
Edit: It was a webserver config issue, fixed in #16449

Does it happen every time?

@cgoldberg
Copy link
Member Author

Does it happen every time?

yea, the tests do it every time... but I can't figure out how to force it to happen in a regular script using the same options and browser.

Copy link
Member

@navin772 navin772 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@cgoldberg cgoldberg merged commit 43d93a9 into SeleniumHQ:trunk Oct 16, 2025
4 checks passed
@cgoldberg cgoldberg deleted the py-use-chrome-for-remote-tests branch October 16, 2025 14:50
@navin772
Copy link
Member

Any file the test tries to download gets downloaded as an .html (.htm on windows) file instead of the correct file extension.

@cgoldberg it was an issue with the webserver that was serving the files, fixed it in #16449, I went wit hfiletype since we already use it in other places but I feel mimetypes would be also good enough (I have commit for both in PR, so you can check the code out).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

B-build Includes scripting, bazel and CI integrations C-py Python Bindings Review effort 2/5

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[🚀 Feature]: [py] Update Remote tests to use Chrome instead of Firefox

3 participants